﻿using System;
using System.Text;

namespace GPS.GPSLanguage
{
    class VerticalDilutionToken
    {
        internal static void ParseLanguage(GPSData gpsData, System.Collections.Queue q)
        {
            String valToken = (string)q.Dequeue();
            double val = 0;

            try
            {
                if (valToken.Length > 0)
                    val = double.Parse(valToken);
            }
            catch
            {

            }

            gpsData.SetVerticalDilution(val);


            switch (gpsData.MessageType)
            {
                case MessageType.GPGSA:
                    gpsData.SetGPSSentenceComplete();
                    break;
                default:
                    throw new InvalidLanguageException("How did you get here?");
            }
        }
    }
}
